﻿using Castle.Windsor;
using MRSite.Common.Dependency;
using MRSite.Common.Kernels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace MRSite.Common.Web
{
    public abstract class WebApplication<T> : HttpApplication, IContainerAccessor
        where T : BaseKernel
    {
        public static Startup Startup { get; } = Startup.Launch<T>(ContainerManager.Instance);

        public IWindsorContainer Container => ContainerManager.Instance.Container;

        protected virtual void Application_Start(object sender, EventArgs e)
        {
            Startup.Initialize();
        }
    }
}
